#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
double jisuan_pi(double eps) {
    double pi = 0.0;
    double term;
    int sign = 1;
    int i = 1;
    do {
        term = sign / (2.0 * i - 1.0);
        pi += term;
        sign = -sign;
        i++;
    } while (fabs(term) >= eps);
    return 4 * pi;
}
int main() {
    double eps;
    scanf("%lf", &eps);
    double pi = jisuan_pi(eps);
    printf("Pi = %.4f\n", pi);
    return 0;
}